﻿using System;

namespace Ooaavee.Scripting
{
    /// <summary>
    /// The exception that is thrown when failed to run a script.
    /// </summary>
    public sealed class ScriptRunException : Exception
    {
        /// <summary>
        /// The programming language.
        /// </summary>
        public Language Language { private set; get; }

        /// <summary>
        /// The full source code.
        /// </summary>
        public string FullSourceCode { private set; get; }

        internal ScriptRunException(string message, Language language, string fullSourceCode, Exception innerException)
            : base(message, innerException)
        {
            Language = language;
            FullSourceCode = fullSourceCode;
        }
    }
}
